import request from '@/utils/request'

export function getStages() {
  return request({
    url: 'api/phuket/getStages',
    method: 'get'
  })
}

export function getConfigsAll() {
  return request({
    url: 'api/phuket/getConfigs',
    method: 'get'
  })
}

export function getConfigs(stageName) {
  return request({
    url: 'api/phuket/getConfigs/' + stageName,
    method: 'get'
  })
}

export function event(stageName, methodName, data) {
  return request({
    url: 'api/phuket/' + stageName + '/' + methodName,
    method: 'post',
    data
  })
}

export function preview(data) {
  return request({
    url: 'api/phuket/preview',
    method: 'post',
    data
  })
}

export function previewDatas(processId) {
  return request({
    url: 'api/phuket/previewData/' + processId,
    method: 'get'
  })
}

export function previewData(processId, shapeId, conditionNum) {
  return request({
    url: 'api/phuket/previewData/' + processId + '/' + shapeId + '/' + conditionNum,
    method: 'get'
  })
}

export default { getStages, getConfigsAll, getConfigs, event, preview, previewData, previewDatas }
